import axios from 'axios';
import store from '../store';

export function getPreview(account){
    return axios.get('/getPreview', {
        params: {
            account: account
        }
    })
    .then(function(response){
        store.dispatch({
            type: 'GET_PREVIEW',
            previewList: response.data.previewList
        });
        window.ACCOUNT = response.data.account;
        return response;
    })
    .catch(function(err){
        console.log(err);
    })
}